package com.atguigu.state.money2.allState;

import com.atguigu.state.money2.AbstractState;
import com.atguigu.state.money2.Context;
import com.atguigu.state.money2.StateEnum;

/**
 * @program: design-patterns
 * @author: yangshen
 * @description: 通用状态（订单生成）
 * @create: 2022-03-31 15:23
 **/
public class GenerateState  extends AbstractState {

    @Override
    public void checkEvent(Context context) {
        context.setState(new ReviewState());
    }

    @Override
    public void checkFailEvent(Context context) {
        context.setState(new FeedBackState());
    }

    @Override
    public String getCurrentState() {
        return StateEnum.GENERATE.getValue();
    }
}
